/**
 * Copyright (C) 2009+ Spark Zheng
 *
 * @file        src/monitor.h 
 * @date        2010-04-05
 * @brief	server_framework
 *		monitor, based on tcp protocol, as a common protocol-module.
 *		it has four purposes(maybe):
 *		-1. collect system runtime data (for gslb/health-check)
 *		-2. collect server-process runtime arguments (for argument-statistics)
 *		-3. monitor server-process runtime arguments, do callbacks on data-exception
 *		-4. online runtime arguments adjusting.
 *
 * @see         dserver
 * @history
 */

#ifndef _DSERVER_MONITOR_H
#define _DSERVER_MONITOR_H

#ifdef __cplusplus
extern "C" {
#endif

#include <dlib/global.h>

#include "protocol.h"
#include "dserver.h"
#include "dserver_log.h"
#include "dserver_errno.h"

#define MONITOR_NAME_STR	"monitor"
	
/**
 * monitor_init
 * @brief constructure of monitor protocol
 * @return 0(success) or <0(failure)
 * @param dc: main dcache context structure
 * @param protocols: the protocol context structure
 */
extern int monitor_init(dserver_t *dc, dserver_protocol_t *protocols);

/**
 * monitor_exit
 * @brief destructure of monitor protocol
 * @param monitor: the monitor protocol node
 */
extern void monitor_exit(prot_node_t *monitor);
	
#ifdef __cplusplus
}
#endif
#endif
